package com.demo.springBoot2.controller;

import com.demo.springBoot2.generator.CodeGenerator;
import com.demo.springBoot2.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author pl711@qq.com
 * @PackageName demo
 * @Package com.edu.demo.controller
 * @Date 2024/3/13 19:13
 * @Version 1.0
 */

@Api(tags = "前端不要动！！")
@RestController
@RequestMapping("/generator")
public class GeneratorController {

    @Autowired
    private CodeGenerator codeGenerator;

    @ApiOperation(value = "生成代码接口")
    @PostMapping("/generateCode")
    public Result generateCode(String tableName,Boolean noController){
        codeGenerator.generator(tableName,noController);
        return Result.success().msg("代码生成成功");
        
    }

}